Skip to content

Show completion item documentation in the suggestion panel#1235

Merged
kishikawakatsumi merged 1 commit into
masterfrom
feature/completion-and-signature-help
Jun 11, 2026
Merged

Show completion item documentation in the suggestion panel#1235
kishikawakatsumi merged 1 commit into
masterfrom
feature/completion-and-signature-help

Conversation

@kishikawakatsumi

Copy link
Copy Markdown
Member

Completion items show only their detail (type) today; this also surfaces the documentation.

sourcekit-lsp already returns documentation inline on each completion item as a MarkupContent ({ kind: "markdown", value }) — verified against the live backend (e.g. String.hasPrefix(_:) ships its full doc comment). The frontend mapping just dropped it, so Monaco never showed the Quick Help / details panel.

This maps item.documentation to Monaco's documentation as a Markdown string. No backend change and no completionItem/resolve round-trip is needed — the data is already in the response.

Verified: webpack build passes.

Follow-up to #1234 (merged). Pairs with the parameter-hints work in that PR and the backend signatureHelp (SwiftFiddle/swiftfiddle-lsp#358).

🤖 Generated with Claude Code

sourcekit-lsp already returns documentation inline on each completion item
(MarkupContent), but the mapping dropped it, so only `detail` was shown. Map
it to Monaco's `documentation` (as a Markdown string) so the Quick Help / docs
panel appears next to the suggestion. No backend or resolve changes needed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 11, 2026 20:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR surfaces SourceKit-LSP completion item documentation in Monaco’s suggestion details panel by mapping the LSP CompletionItem.documentation (already returned inline as MarkupContent) onto Monaco’s documentation field.

Changes:

  • Map item.documentation from the LSP completion response into Monaco completion suggestions.
  • Preserve existing completion mapping behavior (no backend calls / no completionItem/resolve round-trip).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kishikawakatsumi kishikawakatsumi merged commit 42f20b4 into master Jun 11, 2026
2 checks passed
@kishikawakatsumi kishikawakatsumi deleted the feature/completion-and-signature-help branch June 11, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants